package com.gzhryc.shared_device.bxscn.code.dao.enums;

public class BXSCNOrderEnum {

    public static enum State {

        WaitStart(1,"等待租借")
        ,Opening(2,"开仓中")
        ,Lease(3, "租借中")
        ,LeaseFail(4, "租借失败")
        ,RevertFinish(5, "已归还")
        ,Close(6,"订单关闭");

        private Integer index;
        private String note;

        State(Integer index, String note) {
            this.index = index;
            this.note = note;
        }

        public Integer index() {
            return index;
        }

        public String note() {
            return note;
        }

        public static String note(Integer index) {
            State[] temp = State.values();
            for (int i = 0; i < temp.length; i++) {
                State item = temp[i];
                if (item.index.equals(index)) {
                    return item.note;
                }
            }
            return null;
        }
    }

    public static enum PayState {

        WaitPay(1,"等待支付")
        ,DepositSuccess(2,"押金支付成功")
        ,DepositRefund(3, "押金退款中")
        ,Cancel(4,"订单撤销")
        ,PaySuccess(5, "租借费支付成功");

        private Integer index;
        private String note;

        PayState(Integer index, String note) {
            this.index = index;
            this.note = note;
        }

        public Integer index() {
            return index;
        }

        public String note() {
            return note;
        }

        public static String note(Integer index) {
            PayState[] temp = PayState.values();
            for (int i = 0; i < temp.length; i++) {
                PayState item = temp[i];
                if (item.index.equals(index)) {
                    return item.note;
                }
            }
            return null;
        }
    }

    public static enum LeaseErrorState {

        Normal(0,"正常")
        ,NoPortableBattery(1,"无电池可租借")
        ,Timeout(2,"租借超时")
        ,NotRemoved(3, "未取出")
        ,LockException(4,"锁异常");

        private Integer index;
        private String note;

        LeaseErrorState(Integer index, String note) {
            this.index = index;
            this.note = note;
        }

        public Integer index() {
            return index;
        }

        public String note() {
            return note;
        }

        public static String note(Integer index) {
            LeaseErrorState[] temp = LeaseErrorState.values();
            for (int i = 0; i < temp.length; i++) {
                LeaseErrorState item = temp[i];
                if (item.index.equals(index)) {
                    return item.note;
                }
            }
            return null;
        }
    }
}
